let deepClone = function(obj) {
  let copy = Object.create(Object.getPrototypeOf(obj));
  let propNames = Object.getOwnPropertyNames(obj);
  propNames.forEach(function(items) {
    let item = Object.getOwnPropertyDescriptor(obj, items);
    Object.defineProperty(copy, items, item);

  });
  return copy;
};

let testObj = {
  name: "weiqiujuan",
  sex: "girl",
  age: 22,
  favorite: "play",
  family: { brother: "wei", mother: "haha", father: "heihei" }
}
let testRes2 = deepClone(testObj);
testRes2.family.brother = 'glack'
console.log(testObj)
console.log(testRes2);
const func = () => {}
console.log(typeof func == 'function')
const date = new Date(Date.now())
console.log(typeof date)


with(testObj) {
  name = 'glack'
}
console.log(testObj)